# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.VMwareEngine.V1.Model.IpRange do
  @moduledoc """
  An IP range provided in any one of the supported formats.

  ## Attributes

  *   `externalAddress` (*type:* `String.t`, *default:* `nil`) - The name of an `ExternalAddress` resource. The external address must have been reserved in the scope of this external access rule's parent network policy. Provide the external address name in the form of `projects/{project}/locations/{location}/privateClouds/{private_cloud}/externalAddresses/{external_address}`. For example: `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address`.
  *   `ipAddress` (*type:* `String.t`, *default:* `nil`) - A single IP address. For example: `10.0.0.5`.
  *   `ipAddressRange` (*type:* `String.t`, *default:* `nil`) - An IP address range in the CIDR format. For example: `10.0.0.0/24`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :externalAddress => String.t() | nil,
          :ipAddress => String.t() | nil,
          :ipAddressRange => String.t() | nil
        }

  field(:externalAddress)
  field(:ipAddress)
  field(:ipAddressRange)
end

defimpl Poison.Decoder, for: GoogleApi.VMwareEngine.V1.Model.IpRange do
  def decode(value, options) do
    GoogleApi.VMwareEngine.V1.Model.IpRange.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.VMwareEngine.V1.Model.IpRange do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
